home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 37
/
Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso
/
Aminet
/
util
/
moni
/
CopperDecode.lha
/
CopperDecode
/
CopperFile.bas
< prev
next >
Wrap
BASIC Source File
|
1999-05-21
|
3KB
|
65 lines
' Copper List File disasassembler - SNG May 1999, HiSoft BASIC, WB2+
WINDOW 1," AGA Copper Disassembler",(20,16)-(600,150),1+2+4+16+256
ver$="$ver: Copper Disassembler v2.1f © 21 May 1999 Simon N Goodwin"
LIBRARY OPEN "graphics.library":gfxbase&=LIBRARY("graphics.library")
IF gfxbase&=0 THEN PRINT "Graphics library not found!" : STOP
coplist&=PEEKL(gfxbase&+50) : REM Find long Frame Copper list
IF coplist&=0 THEN PRINT "Copper list not found!" : STOP
PRINT
PRINT "This dissasembles the current copper list to a file or device."
PRINT
INPUT "Output Copper list path (e.g. RAM:CLIST) ";file$
PRINT
IF file$="" THEN STOP ELSE OPEN file$ FOR OUTPUT AS #1
c&=coplist&
REPeat dis
w1%=PEEKW(c&) : w2%=PEEKW(c&+2) : PRINT #1; c&,
IF w1% AND 1
REM WAIT or SKIP?
IF w2% AND 1 THEN PRINT #1; "SKIP to "; ELSE PRINT #1; "WAIT for";
PRINT #1; " Y =";PEEK(c&);" X =";(PEEK(c&+1) AND 254);
IF (w2% AND 32766)<>32766 THEN PRINT #1; "& %";BIN$(w2% AND 32766);
PRINT #1;
ELSE
IF w1% AND (&hFE01-65536)
PRINT #1; " Bad MOVE #";FN POS&(w2%);"to ";FN POS&(w1%)
ELSE
PRINT #1; "MOVE "; : SELECT ON w1%
=142 TO 148
PRINT #1; "(X=";PEEK(c&+3);",Y=";PEEK(c&+2);") to ";
IF w1%>144 THEN PRINT #1; "DDF"; : ELSE PRINT #1; "DIW";
IF w1% AND 2 THEN PRINT #1; "START" : ELSE PRINT #1; "STOP"
=224 TO 254
PRINT #1; FN POS&(w2%);"to BPL";CHR$(49+(w1% AND 28)\4);
IF w1% AND 2 THEN PRINT #1; "PTL" : ELSE PRINT #1; "PTH"
=256 TO 262
PRINT #1; "%";BIN$(w2%);" to BPLCON";CHR$(48+((w1%-256)\2))
=264 TO 266
PRINT #1; w2%;"to BPL";CHR$(49+((w1% AND 2)=2));"MOD"
=268: PRINT #1; PEEK(c&+2);"," ;(PEEK(c&+3)\16);
PRINT #1; ",";(PEEK(c&+3) AND 15);"to BPLCON4"
=288 TO 318
PRINT #1; FN POS&(w2%);"to SPR";CHR$(48+(w1% AND 28)\4);
IF w1% AND 2 THEN PRINT #1; "PTL" : ELSE PRINT #1; "PTH"
=384 TO 446: PRINT #1; "R =";(w2%\256);:REM Palette change
PRINT #1; "G =";((w2% AND 240)\16);"B =";(w2% AND 15);
PRINT #1; "to COLOUR";((w1%-384)\2)
=484: PRINT #1; "%";BIN$(w2%);" to DIWHIGH"
=508: PRINT #1; "%";BIN$(w2%);" to FMODE"
=REMAINDER: PRINT #1; FN POS&(w2%);"to $";HEX$(w1%)
END SELect
END IF
END IF : c&=c&+4
IF w1%=-1 AND w2%=-2 THEN PRINT #1; " End of Copper List" : EXIT dis
END REPEAT dis
CLOSE #1
PRINT "Listed to ";file$ : STOP
DEF FN POS&(t%)=-t%*(t%>=0)-(t%<0)*(65536+t%) ' REM Unsigned word